package com.weds.ticket.ticket.data;

import org.springframework.util.StringUtils;

import java.util.HashSet;
import java.util.Set;

/**
 * @Description TODO
 * @Author lihw
 * @Date 2025/8/14 下午5:38
 */

public class Repository {
    private static Set<String> codeList = new HashSet<>();

    public static Set<String> getCodeList() {
        return codeList;
    }

    public static void setCodeList(Set<String> codeList) {
        if (codeList != null && !codeList.isEmpty()) {
            Repository.codeList = codeList;
        }
    }

    public static void addCode(String code) {
        if (StringUtils.hasLength(code)) {
            codeList.add(code);
        }

    }

    public static void removeCode(String code) {
        codeList.remove(code);
    }
}
